/*
隐藏道具配置
景阳冈老虎5火，罗澄坐骑5木，呼延灼5土，史文恭5金,石宝5水
*/
window._SPE = {
    "武松":{item:'朱雀圣骑',qua:'SS',stone:{'火':5}},
    "石宝":{item:'玄武圣骑',qua:'SS',stone:{'水':5}},
    "呼延灼":{item:'银猿圣骑',qua:'SS',stone:{'土':5}},
    "史文恭":{item:'白虎圣骑',qua:'SS',stone:{'金':5}},
    "罗澄":{item:'青龙圣骑',qua:'SS',stone:{'木':5}},
}

window._SPEHELPER = {

    ftypeArr:['金','木','水','火','土'],

    createSpe:function(key){
        var config = _SPE[key];
        var randomParam = {qua:config.qua,stone:[]};
        if(config.stone){
            for(var skey in config.stone){
                var nmb = config.stone[skey];
                for(var i=0;i<nmb;i++){
                    randomParam.stone.push({ftype:skey,value:null});
                }
            }
        }
        return _IOF.createEquip(config.item,randomParam);
    },

    createSpeByNpc:function(npcname){

        if(_NPC[npcname]){

            return _SPEHELPER.randomSpeConfig(_NPC[npcname].job,_NPC[npcname].lv,_NPC[npcname].qua);

        }

        return null;

    },

    randomSpeConfig:function(job,lv,qua){

        var stoneArr = [
            {ftype:_CU.randomObj(_SPEHELPER.ftypeArr),value:null},
            {ftype:_CU.randomObj(_SPEHELPER.ftypeArr),value:null},
            {ftype:_CU.randomObj(_SPEHELPER.ftypeArr),value:null},
            {ftype:_CU.randomObj(_SPEHELPER.ftypeArr),value:null},
            {ftype:_CU.randomObj(_SPEHELPER.ftypeArr),value:null}
        ];
        var randomEquip = [];
        var randomEuipObj = _EQUIPHELPER.getEuipObj(job,lv,qua,stoneArr);
        for(var key in randomEuipObj){
            randomEquip.push(randomEuipObj[key]);
        }
        return _CU.randomObj(randomEquip);
    }

}